<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<style type="text/css">
        img{
        	width:50px;height:30px;
        }
	</style>
	<script type="text/javascript">
	    function toDou(n){
            if(n<10){
           	   return '0' + n;
            }else{
            	return '' + n;
            }
	    }
         
        window.onload = function (){
            //获取系统时间
        	function tick(){
    			//显示年月日
	        	//获取元素
	        	var oDiv1 = document.getElementById('days');
	        	var aImg1 = oDiv1.getElementsByTagName('img');
	            //获取时间
	        	var oDate = new Date();
	        	var str1 = toDou(oDate.getFullYear())+toDou(oDate.getMonth()+1)+toDou(oDate.getDate());      
	        	for(var i=0;i<aImg1.length;i++){
	        		aImg1[i].src = 'img/'+str1[i]+'.jpg';
	        	}


        	    //显示时分秒
        		var oDiv2 = document.getElementById('time');
	        	var aImg2 = oDiv2.getElementsByTagName('img');
	        	var str2 = toDou(oDate.getHours())+toDou(oDate.getMinutes())+toDou(oDate.getSeconds());
	        	for(var j=0;j<aImg2.length;j++){
	        		aImg2[j].src = 'img/'+str2[j]+'.jpg';
	        	}


	        	//获取星期几
	        	var oDiv3 = document.getElementById('now');
	        	var oDate = new Date();
	        	var aImg3 = oDiv3.getElementsByTagName('img');
	        	var str3 = oDate.getDay();

	            aImg3[0].src= 'img/'+str3+'.jpg';  	

        	}



        	setInterval(tick,1000);
        	tick();
        	
        }

	</script>
</head>
<body>

    <div id="days">
   	   	<img src="./img/0.jpg"  />
	    <img src="./img/0.jpg"  />
	    <img src="./img/0.jpg"  />
	    <img src="./img/0.jpg"  />
	    年
	    <img src="./img/0.jpg"  />
	    <img src="./img/0.jpg"  />
	    月
	    <img src="./img/0.jpg" />
	    <img src="./img/0.jpg" />
	    日
    </div>

    <br />
	
    <div id="time" >
   	   <img src="./img/0.jpg"  />
	   <img src="./img/0.jpg"  />
	   :
	   <img src="./img/0.jpg"  />
	   <img src="./img/0.jpg"  />
	   :
	   <img src="./img/0.jpg" />
	   <img src="./img/0.jpg" />
	  
    </div>

    <br />

    <div id="now" style="position:relative;top:-60px;left:380px;">星期 <img src="./img/0.jpg" /></div>

</body>
</html>